#!usr/bin/env python
# -*- coding:utf-8 _*-
"""
# author: 小菠萝测试笔记
# blog:  https://www.cnblogs.com/poloyy/
# time: 2021/10/23 10:32 上午
# file: data_utils.py
"""
from random import randrange
from typing import Optional

from tests.utils.fake_utils import fake, fake_en


def get_users_test_data(
    name: Optional[str] = None,
    username: Optional[str] = None,
    email: Optional[str] = None,
    id: Optional[int] = 0,
):
    name = name if name else fake.name()
    username = username if username else fake.phone_number()
    email = email if email else fake.email()
    data = {
        "username": f"s{username}",
        "name": name,
        "email": email,
        "phone": f"135{randrange(11111111, 99999999)}",
        "avatar": fake.image_url(),
        "ip": fake.ipv4(),
        "password": "123456",
        "is_super": False,
    }
    if id:
        data.update({"id": id})
    return data
